package travelDream.beans;


import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import traveldream.ejb.DTO.PackageDTO;
import traveldream.ejb.DTO.SearchDTO;
import traveldream.ejb.interfaces.SearchBeanLocal;


@ManagedBean(name="searchBean")
@ViewScoped
public class SearchManaged {
	
	private List<PackageDTO> result;

	private SearchDTO sDTO;
	
	
	public SearchManaged()
	{
		sDTO=new SearchDTO();
	}
	
	@EJB
	private SearchBeanLocal searchBeanLocal;

	public List<PackageDTO> getResult() {
		return result;
	}

	public void setResult(List<PackageDTO> result) {
		this.result = result;
	}
	
	public SearchDTO getsDTO() {
		return sDTO;
	}

	public void setsDTO(SearchDTO sDTO) {
		this.sDTO = sDTO;
	}
	
	public String search()
	{
		setResult(searchBeanLocal.search(sDTO));
		return "";
	}

}
